// The Vue build version to load with the `import` command (runtime-only or
// standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';

router.beforeEach(function(to, from, next) {
	console.log(to.meta.requiresAuth);

	if (to.meta.requiresAuth) {
		next({ path: '/login' });
	} else {
		next();
	}
});

import './assets/aui/aui.css';

Vue.config.productionTip = false;

import VueResource from 'vue-resource';
Vue.use(VueResource);

/* eslint-disable no-new */
// new Vue({el: '#app', router, components: {     App   }, template: '<App/>'})
window.apiready = function() {
	new Vue({
		el: '#app',
		router,
		components: {
			App
		},
		template: '<App/>'
	});
};
